from django.test import TestCase

# Create your tests here.


if __name__ == '__main__':
    # 外部启动django的方法,
    import sys, os
    from django.core.wsgi import get_wsgi_application
    base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    # 把django的模板加入到环境中去
    sys.path.append(base_dir)
    # 告诉环境django的配置文件在哪里
    os.environ['DJANGO_SETTINGS_MODULE'] = 'drf_movie_rimi.settings'
    application = get_wsgi_application()
    from mytest.models import Mytest

    # 所有关于django的引入必须在上面环境配置好了之后

    Mytest.objects.create(name='1', age=1)
